package model.commands.environment;

import java.awt.Image;
import model.Environment;
import model.SyntaxErrorException;
import model.commands.Command;

/**
 * Name:
 * CHANGEBG path
 * 
 * Description:
 * Changes the background image to the given path
 * 
 * @author Erick Gonzalez
 */
public class ChangeBackgroundImageCommand extends Command {
    private Image myImage; 
    
    /**
     * 
     * @param image an image
     */
    public ChangeBackgroundImageCommand(Image image) {
        myImage = image;
    }

    @Override
    public int evaluate(Environment myEnvironment) throws SyntaxErrorException {        
        myEnvironment.changeImage(myImage);
        return 1;
    }
    
}
